package org.ch03.test02.demo02;

/**
 * @author ZJL
 * @date 2025-03-25
 */
public class MainTest {
    public static void main(String[] args) {
        ObjectTest ot = new ObjectTest();
        ot.setData("好好学习");

        Object data = ot.getData();

        // 缺点：取值时，需要类型转换
        if (data instanceof String) {
            String s = (String) data;
            System.out.println(s);
        }
    }
}
